Skip to content

Feature: Printing red images & Docker support#4

Open
davidramiro wants to merge 5 commits intotbnobody:extendedfrom
davidramiro:feat/red_images
Open

Feature: Printing red images & Docker support#4
davidramiro wants to merge 5 commits intotbnobody:extendedfrom
davidramiro:feat/red_images

Conversation

@davidramiro
Copy link
Copy Markdown

@davidramiro davidramiro commented Mar 27, 2024

Hi, hope it's okay to make a packed PR like this, I can of course also split it up into one for each changeset.

Swapping upstream brother_ql dependency

Since this seems to be the most maintained fork of the original repo, I was curious about future-proofing it a bit more. I would suggest swapping the brother_ql dependency for the more recent and better packaged brother_ql-inventree. This is totally up for debate, as the original repo vom @pklaus was working for me, except for some minor dependency issue with pillow.

Docker support, arg parsing

I added a Dockerfile which keeps things fairly simple. I have noticed the PR #2, although this is now fairly outdated since you changed to Flasks config instead of manual parsing. Some command line args are needed to pass into the docker container, so I reintroduced some of those. The image uses the official python alpine as base and also downloads some fonts.

Red/"redscale" images

Since printing black/white/red images via brother_ql CLI works very well, I was motivated to add this to the frontend. The naming and UX is up for debate, but I've introduced two new color modes, colored and black_and_red. Colored mode is not processing the image at all, best used with images that are already mostly black, white and red. Think warning signs and stuff. Black and red mode is turning the image to greyscale first, and then mapping midtones to red, so you can pass RGB images and have them use the 2 available colors as good as it allows.

I've attached screenshots of both modes to make it a bit more clear.

Colored mode (no processing):

colored

Red & black processing:

red_black

@brandon-fryslie
Copy link
Copy Markdown

Much appreciated! Docker should be the default since the alternative rates somewhere between stubbing your toe and being poked in the eye on the "fun" scale. You have saved untold hours of engineering effort. You rock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants